package com.android.zhushou.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.android.zhushou.R;
import com.android.zhushou.base.AppBaseAdapter;
import com.android.zhushou.entity.Interview;

/**
 * 面试题的适配器
 */

public class InterviewAdapter extends AppBaseAdapter<Interview> {



    public InterviewAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Interview content = mDatas.get(position);
        ViewHolder holder;
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_interview, null, false);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.tv_mianshi.setText(content.getQuestion());
        return convertView;
    }

    private class ViewHolder {
        private TextView tv_mianshi;

        public ViewHolder(View view) {
            tv_mianshi = (TextView) view.findViewById(R.id.tv_mianshi);
        }
    }
}
